var main = new Vue({
	el: '#main',
	data: {
		name:'xias',
		selected:1,//模块
		wudetails:false,//五件套详情
		sebeidetails:false,//设备详情
		Havedeal:13,//已处理
		undeal:3,//未处理
		alarmnumber:3,//今日报警数
		Onlinenumber:2,//在线设备数
		DeviceID:'',//设备ID
		customername:'',//客户姓名
		addressxc:'',//地址查询
		tabulardata:[//表数据首页
			{
				equipment:'定位设备',
				alarminfor:'离开设定范围',//报警信息
				policeman:'报警人',
				address:'徐汇区桂林路255号6号楼501室',
				eqstate:'1',//为报警中
				alarmtime:'2018-04-02  20:12',
				details:'详情',
			},
			{
				equipment:'定位设备',
				alarminfor:'离开设定范围',//报警信息
				policeman:'报警人',
				address:'徐汇区桂林路255号6号楼501室',
				eqstate:'1',//为报警中
				alarmtime:'2018-04-02  20:12',
				details:'详情',
			},
			{
				equipment:'定位设备',
				alarminfor:'离开设定范围',//报警信息
				policeman:'报警人',
				address:'徐汇区桂林路255号6号楼501室',
				eqstate:'1',//为报警中
				alarmtime:'2018-04-02  20:12',
				details:'详情',
			},
			{
				equipment:'定位设备',
				alarminfor:'离开设定范围',//报警信息
				policeman:'报警人',
				address:'徐汇区桂林路255号6号楼501室',
				eqstate:'1',//为报警中
				alarmtime:'2018-04-02  20:12',
				details:'详情',
			},
			{
				equipment:'定位设备',
				alarminfor:'离开设定范围',//报警信息
				policeman:'报警人',
				address:'徐汇区桂林路255号6号楼501室',
				eqstate:'1',//为报警中
				alarmtime:'2018-04-02  20:12',
				details:'详情',
			},
			{
				equipment:'定位设备',
				alarminfor:'离开设定范围',//报警信息
				policeman:'报警人',
				address:'徐汇区桂林路255号6号楼501室',
				eqstate:'1',//为报警中
				alarmtime:'2018-04-02  20:12',
				details:'详情',
			},
		],
		tabulardata2:[//表数据养老五件套
			{
				equipment:'定位设备',
				alarminfor:'离开设定范围',//报警信息
				policeman:'报警人',
				address:'徐汇区桂林路255号6号楼501室',
				eqstate:'1',//为报警中
				alarmtime:'2018-04-02  20:12',
				details:'详情',
			},
			{
				equipment:'定位设备',
				alarminfor:'离开设定范围',//报警信息
				policeman:'报警人',
				address:'徐汇区桂林路255号6号楼501室',
				eqstate:'1',//为报警中
				alarmtime:'2018-04-02  20:12',
				details:'详情',
			},
			{
				equipment:'定位设备',
				alarminfor:'离开设定范围',//报警信息
				policeman:'报警人',
				address:'徐汇区桂林路255号6号楼501室',
				eqstate:'1',//为报警中
				alarmtime:'2018-04-02  20:12',
				details:'详情',
			},
			{
				equipment:'定位设备',
				alarminfor:'离开设定范围',//报警信息
				policeman:'报警人',
				address:'徐汇区桂林路255号6号楼501室',
				eqstate:'1',//为报警中
				alarmtime:'2018-04-02  20:12',
				details:'详情',
			},
			{
				equipment:'定位设备',
				alarminfor:'离开设定范围',//报警信息
				policeman:'报警人',
				address:'徐汇区桂林路255号6号楼501室',
				eqstate:'1',//为报警中
				alarmtime:'2018-04-02  20:12',
				details:'详情',
			},
			{
				equipment:'定位设备',
				alarminfor:'离开设定范围',//报警信息
				policeman:'报警人',
				address:'徐汇区桂林路255号6号楼501室',
				eqstate:'1',//为报警中
				alarmtime:'2018-04-02  20:12',
				details:'详情',
			},
		],
		tabulardata3:[//表数据体检设备
			{
				equipment:'定位设备',
				alarminfor:'离开设定范围',//报警信息
				policeman:'报警人',
				address:'徐汇区桂林路255号6号楼501室',
				eqstate:'1',//为报警中
				alarmtime:'2018-04-02  20:12',
				details:'详情',
			},
			{
				equipment:'定位设备',
				alarminfor:'离开设定范围',//报警信息
				policeman:'报警人',
				address:'徐汇区桂林路255号6号楼501室',
				eqstate:'1',//为报警中
				alarmtime:'2018-04-02  20:12',
				details:'详情',
			},
			{
				equipment:'定位设备',
				alarminfor:'离开设定范围',//报警信息
				policeman:'报警人',
				address:'徐汇区桂林路255号6号楼501室',
				eqstate:'1',//为报警中
				alarmtime:'2018-04-02  20:12',
				details:'详情',
			},
			{
				equipment:'定位设备',
				alarminfor:'离开设定范围',//报警信息
				policeman:'报警人',
				address:'徐汇区桂林路255号6号楼501室',
				eqstate:'1',//为报警中
				alarmtime:'2018-04-02  20:12',
				details:'详情',
			},
			{
				equipment:'定位设备',
				alarminfor:'离开设定范围',//报警信息
				policeman:'报警人',
				address:'徐汇区桂林路255号6号楼501室',
				eqstate:'1',//为报警中
				alarmtime:'2018-04-02  20:12',
				details:'详情',
			},
			{
				equipment:'定位设备',
				alarminfor:'离开设定范围',//报警信息
				policeman:'报警人',
				address:'徐汇区桂林路255号6号楼501室',
				eqstate:'1',//为报警中
				alarmtime:'2018-04-02  20:12',
				details:'详情',
			},
		],
		note:'备注：',
		popup:false,//弹窗首页
		equipmentone:'定位设备',//弹窗设备类型
		alarminforone:'离开设定范围',//报警信息
		policemanone:'报警人',
		addressone:'徐汇区桂林路255号6号楼501室',
		mattressID:'',//床垫ID
		mattressstyle:'',//床垫状态
		mattressthree:'',//床垫心率
		smokeID:'',//烟感ID
		smokestyle:'',//烟感状态
		smokethree:'',//烟感
		fuelgasID:'',//燃气ID
		fuelgasstyle:'',//燃气状态
		fuelgasthree:'',//燃气
		doorID:'',//门磁ID
		doorstyle:'',//门磁状态
		doorthree:'',//门磁
		infraredID:'',//红外ID
		infraredstyle:'',//红外状态
		infraredthree:'',//红外
		customername:'',//客户姓名客户信息
		customerclass:'',//客户分组客户信息
		customerseid:'',//设备id客户信息
		customersename:'',//设备名称客户信息
		customertime:'',//客户信息测量时间
		Bloodpressure:'',//血压
		Bloodsugar:'',//血糖
		Heartrate:'',//心率
		Totalpage:6,//总页码
		current:3,//当前页
		jumppage:'',//跳转页
	},
	computed:{
		yanglaowu:function(){
			if(this.selected==2 && !this.wudetails){
				return true;
			}else{
				return false;
			}
		},
		tiyansb:function(){
			if(this.selected==3 && !this.sebeidetails){
				return true;
			}else{
				return false;
			}
		},
		yanglaowuxiang:function(){
			if(this.selected==2 && this.wudetails){
				return true;
			}else{
				return false;
			}
		},
		tiyansbxiang:function(){
			if(this.selected==3 && this.sebeidetails){
				return true;
			}else{
				return false;
			}
		}
	},
	methods: {
		gopage:function(nub){
			this.selected=nub;
		},
		opensebeidetails:function(){
			this.sebeidetails=true;
//			console.log(this.$refs.echartsone)
		},
		Thequery:function(){//查询触发函数
			
		},
		Todeal:function(){//首页处理触发函数
			
		},
		gotablepage:function(num){//表格页码跳转
			if(num=='up'){
				if(this.current>1){this.current-=1;}
			}else if(num=='next'){
				if(this.current<this.Totalpage){this.current+=1;}
			}else{
				this.current=num;
			}
			
		}
	}
})
function echartstu(idname,shijian,shuju,shuju2){
	var myChart = echarts.init(document.getElementById(idname));
		 var option = {
			    xAxis: {
			        type: 'category',
			        boundaryGap: false,
			        data: shijian
			    },
			    yAxis: {
			        type: 'value',
			        show: false,//是否显示Y轴
			    },
			    series: [{
			        data: shuju,
			        type: 'line',
			        smooth: true,//显示颜色灌充
			        areaStyle: {},
			        label: {//显示拐点数字
		                normal: {
		                    show: true,
		                    position: 'top'
		                }
		            },
			    },
			    {
			        data: shuju2,
			        type: 'line',
			        smooth: true,//显示颜色灌充
			        areaStyle: {},
			        label: {//显示拐点数字
		                normal: {
		                    show: true,
		                    position: 'top'
		                }
		            },
			    }],
			     color:['#ceeaff', '#91c7ae' ]
			};
	
	  myChart.setOption(option);
  }
echartstu('echartsone',['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],[820, 932, 901, 934, 1290, 1330, 1320],[420, 532, 601, 734, 290, 330, 320]);
//echartstu('echartstwo',['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],[820, 932, 901, 934, 1290, 1330, 1320]);
//echartstu('echartsthree',['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],[820, 932, 901, 934, 1290, 1330, 1320]);